import java.util.*;

public class Week08_7_2 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int i=0;

        Set<String> set = new TreeSet<String>();
        while (sc.hasNextLine()) {
            String str = sc.nextLine();
            if (str.equals("!!!!!")) {
                break;
            } 
            else {
            	if (str.length() == 0) {
                    continue;
                }
   
                String[] str1 = str.split(" +");

                for (String str2 : str1) {
                    set.add(str2);
                }
            }
        }
        System.out.println(set.size());
        for(String e:set){
            if(i==10)
                break;
            System.out.println(e);
            i++;
        }
        sc.close();
    }
}